<template>
	<el-dialog
		:title="`会员${curData.memberName}的德州俱乐部服务费贡献详情`"
		:visible="visible"
		width="800px"
		class="rempadding"
		:destroy-on-close="true"
		:before-close="handleClose"
		@close="handleClose"
	>
		<el-divider></el-divider>
		<el-row class="contentBox">
			<el-col :span="6">会员账号: {{ curData.memberName }}</el-col>
			<el-col :span="6">上级代理: {{ curData.parentProxyName }}</el-col>
			<el-col :span="6">所属总代: {{ curData.topProxyName }}</el-col>
			<el-col :span="6">
				业务模式:
				{{ mappingBusinessModel(curData.businessModel) }}
			</el-col>
		</el-row>
		<el-table
			v-loading="loading"
			element-loading-spinner="el-icon-loading"
			size="mini"
			class="small-size-table"
			:data="data"
			border
			style="width: 100%; margin: 15px 0"
			:max-height="tableHeight"
			:header-cell-style="getRowClass"
			highlight-current-row
		>
			<el-table-column prop="name" align="center" label="项目">
				<template slot-scope="scope">
					{{ scope.row.name }}
				</template>
			</el-table-column>
			<el-table-column prop="userName" align="center" label="服务费贡献">
				<template slot-scope="scope">
					{{ handleTotalNumber('USDT', scope.row.value) }}
				</template>
			</el-table-column>
			<el-table-column prop="userName" align="center" label="占比">
				<template slot-scope="scope">
					<span v-if="scope.row.proportion !== '-'">
						{{ scope.row.proportion }}%
					</span>
					<span v-else>-</span>
				</template>
			</el-table-column>
		</el-table>
	</el-dialog>
</template>

<script>
import list from '@/mixins/list'

export default {
	components: {},
	mixins: [list],
	props: {
		curData: {
			type: Object,
			default: {}
		},
		visible: {
			type: Boolean,
			default: false
		},
		handleVisible: {
			type: Object,
			default: () => {}
		}
	},
	data() {
		return {
			businessModelData: '',
			loading: false,
			tableHeight: 480,
			data: [
				{
					name: '手牌服务费贡献',
					value: 0,
					proportion: 0
				},
				{
					name: '局服务费贡献',
					value: 0,
					proportion: 0
				},
				{
					name: '总计',
					value: 0,
					proportion: '-'
				}
			]
		}
	},
	mounted() {
		this.getData()
	},
	methods: {
		// 获取代理账号信息
		getData() {
			this.data[0].value = this.curData.dxClubServiceChargeHandContributionAmount
			this.data[1].value = this.curData.dxClubServiceChargeRoundContributionAmount
			this.data[2].value =
				Number(this.curData.dxClubServiceChargeHandContributionAmount) +
				Number(this.curData.dxClubServiceChargeRoundContributionAmount)
			// 占比
			this.data[0].proportion =
				this.curData.serviceChargeHandContributionRate || 0
			this.data[1].proportion =
				this.curData.serviceChargeRoundContributionRate || 0
		},
		handleClose() {
			this.$emit('update:visible', false)
		}
	}
}
</script>

<style lang="scss" scoped>
::v-deep .rempadding .el-dialog__header {
	color: #909399;
	font-weight: 700;
}
::v-deep .rempadding .el-dialog__body {
	padding: 0;
	padding-bottom: 30px;
	.contentBox {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.contentBox,
	form {
		padding: 0 20px;
	}
}

::v-deep .el-icon-question:after {
	font-size: 16px;
	margin-left: 0;
}
</style>
